<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <ui:composition template="/private/template/default_layout.xhtml">
            <ui:define name="titulo">Alterar e-mail</ui:define>
            
            <ui:define id="alterar_email_define" name="content">
                <h:form id="alterar_email_form">
                    <center>
                        <br/> <br/><br/><br/><br/><br/><br/><br/>
                        <p:panel id="alterar_email_panel" header="Alteração de E-mail" style="width: 440px">
                            <div id="" align="left">
                                <h:panelGrid id="alterar_email_grid" columns="3">
                                    <h:outputText value="E-mail atual:"/>
                                    <p:inputText id="email_atual" value="#{alterarEmailManagedBean.emailAtual}" 
                                                 validator="#{alterarEmailManagedBean.validarEmailAtual}"/>
                                    <h:message id="message" for="email_atual" style="color: red"/>
                                    <h:outputText value="Novo e-mail:"/>
                                    <p:inputText id="novo_email" value="#{alterarEmailManagedBean.novoEmail}" required="true" 
                                                 requiredMessage="Campo obrigatório" validator="br.uel.ati.validator.novoEmail"/>
                                    <h:message id="message2" for="novo_email" style="color: red"/>
                                </h:panelGrid>
                                <h:panelGrid id="alterar_email_grid_button" columns="2">
                                    <p:commandButton id="alterar_email_confirmar" value="Alterar" style="width: 90px" ajax="false"
                                                     action="#{alterarEmailManagedBean.alterarEmail}" update="message, message2"/>
                                    <p:commandButton id="cancelar" value="Cancelar" style="width: 90px" immediate="true"
                                                     action="#{alterarEmailManagedBean.limpar}" ajax="false"/>
                                </h:panelGrid>
                            </div>
                        </p:panel>
                    </center>
                </h:form>
            </ui:define>
        </ui:composition>
    </h:body>
</html>